function throttle(callback, wait) {
  let start = 0;

  return function (e) {
    const now = Date.now();

    if (now - start >= wait) {
      callback.call(this, e);

      start = now;
    }
  };
}
